<template>
  <div id="app" class="app">

    <router-view/>
  </div>
</template>

<script>
import addressUtil from './utils/addressUtil'
import storageUtil from './utils/storageUtil'
export default {
async  created(){
      
    var coords = await this.initAddress()

  },
  methods:{
        initAddress(){
        console.log("initaddress")
        navigator.geolocation.getCurrentPosition((pos)=>{
         var coords = { latitude: pos.coords.latitude, longitude:pos.coords.longitude}
         
         console.log(coords)
            storageUtil.setCoords(coords)
            return coords
        },function(){
            console.log("获取位置失败");
        },{
            // 配置对象
            timeout: 10000
        });
	  }
  }
}
</script>>

<style lang="stylus" rel="stylesheet/stylus">
  html
    height 100%
    body
      height 100%
      #app
        height 100%
</style>
